
Function createCamera:Int()
	Local obj:B3DEntity	= New B3DEntity
	Local cam:Camera	= getBlitz3D()._scenemanager.createCamera()
	cam.vport			= getBlitz3D()._renderwindow.addViewPort(cam)
	
	obj.obj				= cam
	obj._typ			= cam._typ
	getBlitz3D()._AddEntity(cam.getName(), obj)
	
	Return HandleFromObject(obj)
End Function

Function CameraClsColor(cam:Int, r:Float, g:Float, b:Float)
	Local c:B3DEntity = B3DEntity(HandleToObject(cam))
	Camera(c.obj).vport.setBackgroundColour(r, g, b, 1)
End Function


Function CameraRange(cam:Int, nearClipDistance:Float, farClipDistance:Float)
	Local obj:B3DEntity = B3DEntity(HandleToObject(cam))
	Camera(obj.obj).setNearClipDistance(nearClipDistance)
	Camera(obj.obj).setFarClipDistance(farClipDistance)
End Function


Function ScreenFX(cam:Int, fx:String)
	Local c:B3DEntity = B3DEntity(HandleToObject(cam))
	getBlitz3D().cmp.addCompositor(Camera(c.obj).GetViewport(), fx)
	getBlitz3D().cmp.setCompositorEnabled(Camera(c.obj).GetViewport(), fx)
End Function